<html>
    <head>
        <title>xSys Form Editor - 表单编辑器</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="../css/design-form.css" type="text/css" rel="stylesheet"/>
        <script type="text/javascript" src="../js/commons/commons.js"></script>
        <script type="text/javascript" src="../js/jquery/jquery-1.2.6.js"></script>
        <script type="text/javascript" src="../js/jquery/thickbox/thickbox.js"></script>
        <script type="text/javascript" src="../js/jquery/jquery.form.js"></script>
        <script type="text/javascript" src="../js/commons/jquery_xml.js"></script>
        <script type="text/javascript" src="../js/form/layout.js"></script>
        <script type="text/javascript" src="../js/components/form/form.js"></script>
        <script type="text/javascript" src="../js/components/form/form_class.js"></script>
        <script type="text/javascript">

            var sysFormEditor;

            $(document).ready(function() {
                SysForm.init();
                sysFormEditor = new SysFormClass();
                sysFormEditor.init("FormEditor", {width: 600, height: 400});

                // 内容
                pageInit();

                // layout 布局
                layoutInit();

                // 保存
                // start =============================
                $("#FormDefinitionForm").submit(function() {
                    var options = {
                        success: function() {
                            // post-submit callback
                        }
                    };
                    $("#FormContentText").val(editor.document.body.innerHTML);
                    $("#ServletAction").val("coreBaseManagerServletAction");
                    $("#FormAction").val("save");
                    $("#ModelId").val("WorkflowFormModel");
                    $(this).ajaxSubmit(options);

                    // !!! Important !!!
                    // always return false to prevent standard browser submit and page navigation
                    return false;
                });
                // end ===============================

            });

        </script>
    </head>
    <body>
        <div id="box">
            <!-- head -->
            <div id="header"></div>
            
            <!-- left -->
            <div id="left" align="left" style="display:none">
            </div>
            
            <!-- content -->
            <div id="content">
                <form id="FormDefinitionForm" action="../stringRes" method="post">
                    <div id="FormInfo">
                        Name :
                        <input type="text" name="form_name_" id="FormName" value="">
                        Desc :
                        <input type="text" name="desc_" id="FormDesc" value="">
                        <input type="hidden" name="create_date_" id="CreateDate" value="3342533243">
                        <input type="submit" id="FormSave" value="Save">
                        <input type="hidden" id="ServletAction" name="s" value="">
                        <input type="hidden" id="FormAction" name="a" value="">
                        <input type="hidden" id="ModelId" name="i" value="">
                    </div>
                    <div id="FormEditor"></div>
                    <div id="FormContent" style="display:none">
                        <textarea id="FormContentText" name="form_content_" style="display:none"></textarea>
                    </div>
                </form>
            </div>
            
            <!-- foot -->
            <div id="footer"><div align="left" style="padding:5px;">
                &copy; 2008 Powerhua. All rights reserved.</div>
            </div>
        </div>
    </body>
</html>
